/*
 * ScatterProps2.java
 *
 * Created on 21. april 2002, 14:07
 */
package no.uib.jexpress_modularized.core.visualization.charts.GUI;
import no.uib.jexpress_modularized.core.visualization.colors.colorcomponents.*;
import no.uib.jexpress_modularized.core.visualization.colors.ui.*;
import no.uib.jexpress_modularized.core.visualization.charts.*;
import no.uib.jexpress_modularized.core.visualization.*;

//import foldChange.foldChange;
import java.util.*;
import no.uib.jexpress_modularized.core.visualization.Tools;
//import Tools;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.Serializable;

/**
 *
 * @author  bjarte dysvik
 */
public class ScatterProps2 extends javax.swing.JDialog implements Serializable{
    public DensScatterPlot plot;
    private Hashtable props;
    private ColorFactoryList colorList;
    private ColorFactory fac;
   
    /** Creates new form ScatterProps2 */
    public ScatterProps2(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
 
        /** Creates new form ScatterProps2 */
    public ScatterProps2(java.awt.Dialog parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    public ScatterProps2(java.awt.Frame parent, boolean modal, DensScatterPlot plot) {
        super(parent, modal);
        this.plot=plot;
        initComponents();
        plot.getBackgroundFactory().fillCombo(SbgSV);
        plot.getBackgroundFactory().fillGradCombo(gradtypeSV);
        if(plot.Layout!=null) fromHash(plot.Layout);
        Xaxis.setText(plot.xaxis.getTitleText());
        Yaxis.setText(plot.yaxis.getTitleText());
        
        if(plot.isEqualScales()){
            
            xmin.setEnabled(false);
            ymin.setEnabled(false);
            xmax.setEnabled(false);
            ymax.setEnabled(false);
            endlabelsSV.setEnabled(false);
            reset.setEnabled(false);
       }
        
    }
    
     public ScatterProps2(java.awt.Dialog parent, boolean modal, DensScatterPlot plot) {
        super(parent, modal);
        this.plot=plot;
        initComponents();
        plot.getBackgroundFactory().fillCombo(SbgSV);
        plot.getBackgroundFactory().fillGradCombo(gradtypeSV);
        if(plot.Layout!=null) fromHash(plot.Layout);
        Xaxis.setText(plot.xaxis.getTitleText());
        Yaxis.setText(plot.yaxis.getTitleText());
    
        if(plot.isEqualScales()){
            
            xmin.setEnabled(false);
            ymin.setEnabled(false);
            xmax.setEnabled(false);
            ymax.setEnabled(false);
            endlabelsSV.setEnabled(false);
            reset.setEnabled(false);
       }
    }
     
     
     
     public void setupColorFactoryCombo(final Hashtable props, ColorFactoryList colorList){
       
       if(props.containsKey("ScatterPlotColorTableID")){
          int colorTableID = (Integer)props.get("ScatterPlotColorTableID");
          fac = colorList.getColorFactoryByID(colorTableID).getDerivedFactory();
        }
        else fac = colorList.getActiveColorFactory();
        
        fac = fac.getDerivedFactory();
    
       
        final ColorTableCombobox cb = new ColorTableCombobox();
        cb.setFactoryList(colorList);
        cb.setSelectedItem(colorList.getColorFactoryByID(fac.getID()));
    
        cb.addItemListener(new ItemListener(){
        public void itemStateChanged(ItemEvent e) {
          
          if(cb.getSelectedItem()==null) return;
          else if(cb.getSelectedItem()==fac) return;
          props.put("ScatterPlotColorTableID", fac.getID());
          fac = ((ColorFactory)cb.getSelectedItem()).getDerivedFactory();
          plot.setColorFactory(fac);
          plot.forceFullRepaint();
        }
        });
        jPanel2.add(cb);
     }
     
     
     
    public void fromHash(Hashtable hash){
        Tools.ObjectFromHash(this,hash);
        props = hash;
//        updateInterpolator();
    }
    
    public Hashtable toHash(){
        Hashtable ret = Tools.objectToHash(this);
     
        ret.put("xmin",new Double(xmin.getValue()));
        ret.put("ymin",new Double(ymin.getValue()));
        ret.put("xmax",new Double(xmax.getValue()));
        ret.put("ymax",new Double(ymax.getValue()));
        
        ret.put("xaxisTitle",Xaxis.getText());
        ret.put("yaxisTitle",Yaxis.getText());
        ret.put("topText",Header.getText());
        
        return ret;
    }
    
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is 
     * always regenerated by the Form Editor.
     */

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        jEPanel1 = new JEPanel();
        jPanel10 = new javax.swing.JPanel();
        buttonpanel1 = new javax.swing.JPanel();
        jButton22211 = new javax.swing.JButton();
        buttonpanel = new javax.swing.JPanel();
        defaults = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        ok = new javax.swing.JButton();
        close = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel5 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        SbgSV = new javax.swing.JComboBox();
        chartbgpanel = new javax.swing.JPanel();
        jLabel121 = new javax.swing.JLabel();
        chartbgSV = new ColorButton();
        jLabel1212 = new javax.swing.JLabel();
        axisbgSV = new ColorButton();
        bgpanels = new javax.swing.JPanel();
        gradientpanel = new javax.swing.JPanel();
        jLabel122 = new javax.swing.JLabel();
        grad1SV = new ColorButton();
        jLabel1221 = new javax.swing.JLabel();
        grad2SV = new ColorButton();
        jLabel1222 = new javax.swing.JLabel();
        gradtypeSV = new javax.swing.JComboBox();
        denspanel = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel111 = new javax.swing.JLabel();
        jLabel112 = new javax.swing.JLabel();
        densareaSV = new WholeNumberField();
        tresholdSV = new WholeNumberField();
        colorsSV = new WholeNumberField();
        jPanel2 = new javax.swing.JPanel();
        singlebgpanel = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        singlebgSV = new ColorButton();
        picturepanel = new javax.swing.JPanel();
        pathSV = new javax.swing.JTextField();
        jLabel122212 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        stretchSV = new javax.swing.JRadioButton();
        tileSV = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        spotpanel = new javax.swing.JPanel();
        jLabel12221 = new javax.swing.JLabel();
        dotsizeSV = new WholeNumberField();
        Header = new javax.swing.JTextField();
        jLabel122211 = new javax.swing.JLabel();
        circSV = new javax.swing.JCheckBox();
        frameSV = new javax.swing.JCheckBox();
        xaxispanel = new javax.swing.JPanel();
        jLabel12111 = new javax.swing.JLabel();
        jLabel121111 = new javax.swing.JLabel();
        jLabel121112 = new javax.swing.JLabel();
        mixticsSV = new WholeNumberField();
        Xaxis = new javax.swing.JTextField();
        xticsbothsidesSV = new javax.swing.JCheckBox();
        yaxispanel = new javax.swing.JPanel();
        jLabel121113 = new javax.swing.JLabel();
        jLabel1211111 = new javax.swing.JLabel();
        jLabel1211121 = new javax.swing.JLabel();
        miyticsSV = new WholeNumberField();
        Yaxis = new javax.swing.JTextField();
        yticsbothsidesSV = new javax.swing.JCheckBox();
        gridpanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        gridColorSV = new ColorButton();
        paintGridSV = new javax.swing.JCheckBox();
        jLabel31 = new javax.swing.JLabel();
        transparencySV = new javax.swing.JSlider();
        jLabel12121 = new javax.swing.JLabel();
        nullSV = new ColorButton();
        valuesx = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        xmin = new DoubleField();
        xmax = new DoubleField();
        ymin = new DoubleField();
        ymax = new DoubleField();
        endlabelsSV = new javax.swing.JCheckBox();
        jSeparator21 = new javax.swing.JSeparator();
        reset = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        showTrendSV = new javax.swing.JCheckBox();
        jPanel7 = new javax.swing.JPanel();
        numpSV = new javax.swing.JRadioButton();
        xaxSV = new javax.swing.JRadioButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        weightSV = new DoubleField();
        pointsSV = new DoubleField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        widthSV = new DoubleField();
        trendcSV = new ColorButton();
        jLabel8 = new javax.swing.JLabel();
        minpSV = new DoubleField();
        jPanel11 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        trendtransSV = new javax.swing.JSlider();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Plot Properties");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        jEPanel1.setPaintText(false);
        jEPanel1.setLayout(new java.awt.BorderLayout());

        jPanel10.setOpaque(false);
        jPanel10.setLayout(new java.awt.GridLayout(1, 0));

        buttonpanel1.setBackground(new java.awt.Color(204, 204, 214));
        buttonpanel1.setOpaque(false);
        buttonpanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        jButton22211.setBackground(new java.awt.Color(204, 204, 214));
        jButton22211.setFont(new java.awt.Font("Dialog", 0, 12));
        jButton22211.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/paste.gif"))); // NOI18N
        jButton22211.setText("Copy Image To Clipboard");
        jButton22211.setToolTipText("Copy Chart Image to Clipboard");
        jButton22211.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton22211ActionPerformed(evt);
            }
        });
        buttonpanel1.add(jButton22211);

        jPanel10.add(buttonpanel1);

        buttonpanel.setBackground(new java.awt.Color(204, 204, 214));
        buttonpanel.setOpaque(false);
        buttonpanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        defaults.setBackground(new java.awt.Color(204, 204, 214));
        defaults.setFont(new java.awt.Font("Dialog", 0, 12));
        defaults.setText("Set Defaults");
        defaults.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                defaultsActionPerformed(evt);
            }
        });
        buttonpanel.add(defaults);

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setPreferredSize(new java.awt.Dimension(10, 22));
        buttonpanel.add(jSeparator1);

        ok.setBackground(new java.awt.Color(204, 204, 214));
        ok.setFont(new java.awt.Font("Dialog", 0, 12));
        ok.setText("Ok");
        ok.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okActionPerformed(evt);
            }
        });
        buttonpanel.add(ok);

        close.setBackground(new java.awt.Color(204, 204, 214));
        close.setFont(new java.awt.Font("Dialog", 0, 12));
        close.setText("Close");
        close.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeActionPerformed(evt);
            }
        });
        buttonpanel.add(close);

        jPanel10.add(buttonpanel);

        jEPanel1.add(jPanel10, java.awt.BorderLayout.SOUTH);

        jPanel5.setBackground(new java.awt.Color(237, 237, 236));
        jPanel5.setLayout(new java.awt.GridBagLayout());

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Fill"));
        jPanel1.setMinimumSize(new java.awt.Dimension(209, 22));
        jPanel1.setOpaque(false);
        jPanel1.setPreferredSize(new java.awt.Dimension(213, 25));
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0));

        jLabel1.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1.setText("Chart Area");
        jPanel1.add(jLabel1);

        SbgSV.setMinimumSize(new java.awt.Dimension(126, 17));
        SbgSV.setPreferredSize(new java.awt.Dimension(130, 20));
        SbgSV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SbgSVActionPerformed(evt);
            }
        });
        jPanel1.add(SbgSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(jPanel1, gridBagConstraints);


        chartbgpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Chart & axis color"));
        chartbgpanel.setOpaque(false);
        chartbgpanel.setLayout(new java.awt.GridBagLayout());

        jLabel121.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel121.setText("Chart Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 6);
        chartbgpanel.add(jLabel121, gridBagConstraints);

        chartbgSV.setPreferredSize(new java.awt.Dimension(18, 15));
        chartbgSV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chartbgSVActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0);
        chartbgpanel.add(chartbgSV, gridBagConstraints);

        jLabel1212.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1212.setText("Axis Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 6);
        chartbgpanel.add(jLabel1212, gridBagConstraints);

        axisbgSV.setPreferredSize(new java.awt.Dimension(18, 15));
        axisbgSV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                axisbgSVActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        chartbgpanel.add(axisbgSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(chartbgpanel, gridBagConstraints);

        bgpanels.setOpaque(false);
        bgpanels.setLayout(new java.awt.CardLayout());

        gradientpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Gradient Background")); 
        gradientpanel.setOpaque(false);
        gradientpanel.setLayout(new java.awt.GridBagLayout());

        jLabel122.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel122.setText("Color 1");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
        gradientpanel.add(jLabel122, gridBagConstraints);

        grad1SV.setMaximumSize(new java.awt.Dimension(325, 11231));
        grad1SV.setMinimumSize(new java.awt.Dimension(10, 11));
        grad1SV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gradientpanel.add(grad1SV, gridBagConstraints);

        jLabel1221.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1221.setText("Color 2");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gradientpanel.add(jLabel1221, gridBagConstraints);

        grad2SV.setMaximumSize(new java.awt.Dimension(325, 11231));
        grad2SV.setMinimumSize(new java.awt.Dimension(10, 11));
        grad2SV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
        gradientpanel.add(grad2SV, gridBagConstraints);

        jLabel1222.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1222.setText("Gradient Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 4);
        gradientpanel.add(jLabel1222, gridBagConstraints);

        gradtypeSV.setPreferredSize(new java.awt.Dimension(130, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
        gradientpanel.add(gradtypeSV, gridBagConstraints);

        bgpanels.add(gradientpanel, "card3");

        denspanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Density Map"));
        denspanel.setOpaque(false);
        denspanel.setPreferredSize(new java.awt.Dimension(127, 126));
        denspanel.setLayout(new java.awt.GridBagLayout());

        jLabel11.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel11.setText("Density Area");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 0, 0);
        denspanel.add(jLabel11, gridBagConstraints);

        jLabel111.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel111.setText("Number of Colors");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 0, 0);
        denspanel.add(jLabel111, gridBagConstraints);

        jLabel112.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel112.setText("Paint Treshold (%)");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 0, 0);
        denspanel.add(jLabel112, gridBagConstraints);

        densareaSV.setBackground(new java.awt.Color(202, 220, 202));
        densareaSV.setColumns(4);
        densareaSV.setText("100");
        densareaSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(1, 4, 0, 0);
        denspanel.add(densareaSV, gridBagConstraints);

        tresholdSV.setBackground(new java.awt.Color(202, 220, 202));
        tresholdSV.setColumns(4);
        tresholdSV.setText("100");
        tresholdSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(1, 4, 0, 0);
        denspanel.add(tresholdSV, gridBagConstraints);

        colorsSV.setBackground(new java.awt.Color(202, 220, 202));
        colorsSV.setColumns(4);
        colorsSV.setText("300");
        colorsSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(1, 4, 0, 0);
        denspanel.add(colorsSV, gridBagConstraints);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("null"));
        jPanel2.setOpaque(false);
        jPanel2.setPreferredSize(new java.awt.Dimension(217, 60));
        jPanel2.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridwidth = 3;
        denspanel.add(jPanel2, gridBagConstraints);

        bgpanels.add(denspanel, "card1");

        singlebgpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Single Color Background"));
        singlebgpanel.setOpaque(false);

        jLabel12.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel12.setText("Background Color");
        singlebgpanel.add(jLabel12);

        singlebgSV.setPreferredSize(new java.awt.Dimension(18, 15));
        singlebgpanel.add(singlebgSV);

        bgpanels.add(singlebgpanel, "card2");

        picturepanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Background picture"));
        picturepanel.setOpaque(false);
        picturepanel.setLayout(new java.awt.GridBagLayout());

        pathSV.setBackground(new java.awt.Color(202, 202, 220));
        pathSV.setFont(new java.awt.Font("Arial", 0, 12));
        pathSV.setPreferredSize(new java.awt.Dimension(210, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);
        picturepanel.add(pathSV, gridBagConstraints);

        jLabel122212.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel122212.setText("Picture Path");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        picturepanel.add(jLabel122212, gridBagConstraints);

        jButton1.setFont(new java.awt.Font("Dialog", 0, 12));
        jButton1.setText("Select File");
        jButton1.setPreferredSize(new java.awt.Dimension(101, 24));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        picturepanel.add(jButton1, gridBagConstraints);

        jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(155, 155, 155)));
        jPanel3.setOpaque(false);
        jPanel3.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0));

        buttonGroup1.add(stretchSV);
        stretchSV.setFont(new java.awt.Font("Dialog", 0, 12));
        stretchSV.setSelected(true);
        stretchSV.setText("Stretch");
        stretchSV.setOpaque(false);
        jPanel3.add(stretchSV);

        buttonGroup1.add(tileSV);
        tileSV.setFont(new java.awt.Font("Dialog", 0, 12));
        tileSV.setText("Tile");
        tileSV.setOpaque(false);
        jPanel3.add(tileSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 0, 0, 0);
        picturepanel.add(jPanel3, gridBagConstraints);

        bgpanels.add(picturepanel, "card4");

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("-"));
        jPanel4.setOpaque(false);
        bgpanels.add(jPanel4, "card5");

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(bgpanels, gridBagConstraints);

        spotpanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Div"));
        spotpanel.setOpaque(false);
        spotpanel.setLayout(new java.awt.GridBagLayout());

        jLabel12221.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel12221.setText("Spot Size");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        spotpanel.add(jLabel12221, gridBagConstraints);

        dotsizeSV.setBackground(new java.awt.Color(202, 220, 202));
        dotsizeSV.setColumns(4);
        dotsizeSV.setText("5");
        dotsizeSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        spotpanel.add(dotsizeSV, gridBagConstraints);

        Header.setBackground(new java.awt.Color(202, 202, 220));
        Header.setColumns(15);
        Header.setMinimumSize(new java.awt.Dimension(4, 17));
        Header.setPreferredSize(new java.awt.Dimension(169, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        spotpanel.add(Header, gridBagConstraints);

        jLabel122211.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel122211.setText("Chart Title");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        spotpanel.add(jLabel122211, gridBagConstraints);

        circSV.setFont(new java.awt.Font("Dialog", 0, 12));
        circSV.setText("Circular spots");
        circSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
        spotpanel.add(circSV, gridBagConstraints);

        frameSV.setFont(new java.awt.Font("Dialog", 0, 12));
        frameSV.setText("Framed");
        frameSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        spotpanel.add(frameSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(spotpanel, gridBagConstraints);

        xaxispanel.setBorder(javax.swing.BorderFactory.createTitledBorder("X Axis"));
        xaxispanel.setOpaque(false);
        xaxispanel.setLayout(new java.awt.GridBagLayout());

        jLabel12111.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel12111.setText("Title");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        xaxispanel.add(jLabel12111, gridBagConstraints);

        jLabel121111.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel121111.setText("Minor Tics");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        xaxispanel.add(jLabel121111, gridBagConstraints);

        jLabel121112.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel121112.setText("Tics In Both Ends");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
        xaxispanel.add(jLabel121112, gridBagConstraints);

        mixticsSV.setBackground(new java.awt.Color(202, 220, 202));
        mixticsSV.setColumns(4);
        mixticsSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        xaxispanel.add(mixticsSV, gridBagConstraints);

        Xaxis.setBackground(new java.awt.Color(202, 202, 220));
        Xaxis.setColumns(15);
        Xaxis.setPreferredSize(new java.awt.Dimension(169, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0);
        xaxispanel.add(Xaxis, gridBagConstraints);

        xticsbothsidesSV.setMargin(new java.awt.Insets(2, 0, 2, 2));
        xticsbothsidesSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        xaxispanel.add(xticsbothsidesSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(xaxispanel, gridBagConstraints);

        yaxispanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Y Axis"));
        yaxispanel.setOpaque(false);
        yaxispanel.setLayout(new java.awt.GridBagLayout());

        jLabel121113.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel121113.setText("Title");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        yaxispanel.add(jLabel121113, gridBagConstraints);

        jLabel1211111.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1211111.setText("Minor Tics");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        yaxispanel.add(jLabel1211111, gridBagConstraints);

        jLabel1211121.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1211121.setText("Tics In Both Ends");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
        yaxispanel.add(jLabel1211121, gridBagConstraints);

        miyticsSV.setBackground(new java.awt.Color(202, 220, 202));
        miyticsSV.setColumns(4);
        miyticsSV.setPreferredSize(new java.awt.Dimension(48, 17));
        miyticsSV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miyticsSVActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        yaxispanel.add(miyticsSV, gridBagConstraints);

        Yaxis.setBackground(new java.awt.Color(202, 202, 220));
        Yaxis.setColumns(15);
        Yaxis.setPreferredSize(new java.awt.Dimension(169, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0);
        yaxispanel.add(Yaxis, gridBagConstraints);

        yticsbothsidesSV.setMargin(new java.awt.Insets(2, 0, 2, 2));
        yticsbothsidesSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        yaxispanel.add(yticsbothsidesSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(yaxispanel, gridBagConstraints);

        gridpanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Grid", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        gridpanel1.setOpaque(false);
        gridpanel1.setLayout(new java.awt.GridBagLayout());

        jLabel3.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel3.setText("Grid Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        gridpanel1.add(jLabel3, gridBagConstraints);

        gridColorSV.setColor(new java.awt.Color(200, 200, 200));
        gridColorSV.setMaximumSize(new java.awt.Dimension(15, 15));
        gridColorSV.setMinimumSize(new java.awt.Dimension(15, 15));
        gridColorSV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 8);
        gridpanel1.add(gridColorSV, gridBagConstraints);

        paintGridSV.setFont(new java.awt.Font("Dialog", 0, 12));
        paintGridSV.setText("Paint Grid");
        paintGridSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridpanel1.add(paintGridSV, gridBagConstraints);

        jLabel31.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel31.setText("Grid Transparency");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        gridpanel1.add(jLabel31, gridBagConstraints);

        transparencySV.setMajorTickSpacing(10);
        transparencySV.setMaximum(254);
        transparencySV.setInverted(true);
        transparencySV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 4;
        gridpanel1.add(transparencySV, gridBagConstraints);

        jLabel12121.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel12121.setText("Axis 0.0 color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridpanel1.add(jLabel12121, gridBagConstraints);

        nullSV.setColor(new java.awt.Color(200, 200, 200));
        nullSV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        gridpanel1.add(nullSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(gridpanel1, gridBagConstraints);

        valuesx.setBorder(javax.swing.BorderFactory.createTitledBorder("Value span"));
        valuesx.setOpaque(false);
        valuesx.setLayout(new java.awt.GridBagLayout());

        jLabel2.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel2.setText("XMin");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 2);
        valuesx.add(jLabel2, gridBagConstraints);

        jLabel21.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel21.setText("XMax");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 7);
        valuesx.add(jLabel21, gridBagConstraints);

        jLabel22.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel22.setText("YMin");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 2);
        valuesx.add(jLabel22, gridBagConstraints);

        jLabel23.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel23.setText("YMax");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 2);
        valuesx.add(jLabel23, gridBagConstraints);

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator2.setPreferredSize(new java.awt.Dimension(2, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 9;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 3, 7);
        valuesx.add(jSeparator2, gridBagConstraints);

        xmin.setBackground(new java.awt.Color(245, 245, 255));
        xmin.setColumns(4);
        xmin.setMinimumSize(new java.awt.Dimension(4, 17));
        xmin.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(xmin, gridBagConstraints);

        xmax.setBackground(new java.awt.Color(245, 245, 255));
        xmax.setColumns(4);
        xmax.setMinimumSize(new java.awt.Dimension(4, 17));
        xmax.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(xmax, gridBagConstraints);

        ymin.setBackground(new java.awt.Color(245, 245, 255));
        ymin.setColumns(4);
        ymin.setMinimumSize(new java.awt.Dimension(4, 17));
        ymin.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(ymin, gridBagConstraints);

        ymax.setBackground(new java.awt.Color(245, 245, 255));
        ymax.setColumns(4);
        ymax.setMinimumSize(new java.awt.Dimension(4, 17));
        ymax.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(ymax, gridBagConstraints);

        endlabelsSV.setFont(new java.awt.Font("Dialog", 0, 12));
        endlabelsSV.setText("Force Endlabels");
        endlabelsSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 10;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
        valuesx.add(endlabelsSV, gridBagConstraints);

        jSeparator21.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator21.setPreferredSize(new java.awt.Dimension(2, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 3, 7);
        valuesx.add(jSeparator21, gridBagConstraints);

        reset.setFont(new java.awt.Font("Dialog", 0, 12));
        reset.setText("Reset");
        reset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 11;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
        valuesx.add(reset, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel5.add(valuesx, gridBagConstraints);

        jTabbedPane1.addTab("Plot Properties", jPanel5);

        jPanel6.setBackground(new java.awt.Color(250, 250, 249));
        jPanel6.setLayout(new java.awt.GridBagLayout());

        showTrendSV.setText("Show TrendLine");
        showTrendSV.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        showTrendSV.setMargin(new java.awt.Insets(0, 0, 0, 0));
        showTrendSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 2, 11, 0);
        jPanel6.add(showTrendSV, gridBagConstraints);

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Trend Type"));
        jPanel7.setOpaque(false);
        jPanel7.setLayout(new java.awt.GridBagLayout());

        buttonGroup2.add(numpSV);
        numpSV.setText("Number of Points");
        numpSV.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        numpSV.setMargin(new java.awt.Insets(0, 0, 0, 0));
        numpSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
        jPanel7.add(numpSV, gridBagConstraints);

        buttonGroup2.add(xaxSV);
        xaxSV.setSelected(true);
        xaxSV.setText("X axis area");
        xaxSV.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        xaxSV.setMargin(new java.awt.Insets(0, 0, 0, 0));
        xaxSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 1);
        jPanel7.add(xaxSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        jPanel6.add(jPanel7, gridBagConstraints);

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Trend Properties"));
        jPanel8.setOpaque(false);
        jPanel8.setLayout(new java.awt.GridBagLayout());

        jLabel4.setText("Number of points");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 8, 1, 2);
        jPanel8.add(jLabel4, gridBagConstraints);

        jLabel5.setText("Minimum Points");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 8, 1, 2);
        jPanel8.add(jLabel5, gridBagConstraints);

        weightSV.setBackground(new java.awt.Color(245, 245, 255));
        weightSV.setColumns(4);
        weightSV.setText("0.3");
        weightSV.setMinimumSize(new java.awt.Dimension(4, 17));
        weightSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 5);
        jPanel8.add(weightSV, gridBagConstraints);

        pointsSV.setBackground(new java.awt.Color(245, 245, 255));
        pointsSV.setColumns(4);
        pointsSV.setText("0.05");
        pointsSV.setMinimumSize(new java.awt.Dimension(4, 17));
        pointsSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 5);
        jPanel8.add(pointsSV, gridBagConstraints);

        jLabel6.setText("Trend Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 8, 1, 2);
        jPanel8.add(jLabel6, gridBagConstraints);

        jLabel7.setText("Trend Width");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 8, 1, 2);
        jPanel8.add(jLabel7, gridBagConstraints);

        widthSV.setBackground(new java.awt.Color(245, 245, 255));
        widthSV.setColumns(4);
        widthSV.setText("6");
        widthSV.setMinimumSize(new java.awt.Dimension(4, 17));
        widthSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 5);
        jPanel8.add(widthSV, gridBagConstraints);

        trendcSV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 5);
        jPanel8.add(trendcSV, gridBagConstraints);

        jLabel8.setText("Weight Window");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 8, 1, 2);
        jPanel8.add(jLabel8, gridBagConstraints);

        minpSV.setBackground(new java.awt.Color(245, 245, 255));
        minpSV.setColumns(4);
        minpSV.setText("30");
        minpSV.setMinimumSize(new java.awt.Dimension(4, 17));
        minpSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(1, 1, 1, 5);
        jPanel8.add(minpSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        jPanel6.add(jPanel8, gridBagConstraints);

        jPanel11.setOpaque(false);
        jPanel11.setLayout(new java.awt.GridBagLayout());
        jPanel6.add(jPanel11, new java.awt.GridBagConstraints());

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Trend Transparency"));
        jPanel12.setOpaque(false);

        trendtransSV.setMajorTickSpacing(10);
        trendtransSV.setMaximum(254);
        trendtransSV.setInverted(true);
        trendtransSV.setOpaque(false);
        jPanel12.add(trendtransSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jPanel6.add(jPanel12, gridBagConstraints);

        jTabbedPane1.addTab("Trend Line", jPanel6);

        jEPanel1.add(jTabbedPane1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jEPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents



    private void jButton22211ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22211ActionPerformed

//        jexpress.ImageHandler.ImageToClipBoard(plot.getImage());

    }//GEN-LAST:event_jButton22211ActionPerformed



    private void resetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetActionPerformed

              /*

               plot.invalidValues=plot.xaxis.resetAxis(plot.Rx);

              plot.invalidValues= plot.addInvalidValues(plot.invalidValues, plot.yaxis.resetAxis(plot.Ry));

              plot.updateAxisValues();

              plot.forceFullRepaint();

              */

              plot.resetAxis();

              

    }//GEN-LAST:event_resetActionPerformed













    private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okActionPerformed

        plot.Layout=this.toHash();

        plot.forceFullRepaint();

    }//GEN-LAST:event_okActionPerformed



    private void defaultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_defaultsActionPerformed

        plot.Layout=this.toHash();

        plot.writeValues();

    }//GEN-LAST:event_defaultsActionPerformed



    private void chartbgSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chartbgSVActionPerformed

        // Add your handling code here:

    }//GEN-LAST:event_chartbgSVActionPerformed



    private void axisbgSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_axisbgSVActionPerformed

        // Add your handling code here:

    }//GEN-LAST:event_axisbgSVActionPerformed



    private void SbgSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SbgSVActionPerformed

        if(SbgSV.getSelectedIndex()==0) ((java.awt.CardLayout)bgpanels.getLayout()).show(bgpanels,"card1"); 

        else if(SbgSV.getSelectedIndex()==1) ((java.awt.CardLayout)bgpanels.getLayout()).show(bgpanels,"card2");

        else if(SbgSV.getSelectedIndex()==2) ((java.awt.CardLayout)bgpanels.getLayout()).show(bgpanels,"card3");

        else if(SbgSV.getSelectedIndex()==3) ((java.awt.CardLayout)bgpanels.getLayout()).show(bgpanels,"card4");

        else ((java.awt.CardLayout)bgpanels.getLayout()).show(bgpanels,"card5");

        

    }//GEN-LAST:event_SbgSVActionPerformed



    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

     javax.swing.JFileChooser chooser = new javax.swing.JFileChooser();

//     chooser.setFileFilter(new ImageFilter());

    

    int returnVal = chooser.showOpenDialog(null);

    if(returnVal == javax.swing.JFileChooser.APPROVE_OPTION) {

    

         pathSV.setText(chooser.getSelectedFile().getAbsolutePath());

    }

 

    }//GEN-LAST:event_jButton1ActionPerformed



    private void closeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeActionPerformed

       setVisible(false);

    }//GEN-LAST:event_closeActionPerformed



    private void miyticsSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miyticsSVActionPerformed

        // Add your handling code here:

    }//GEN-LAST:event_miyticsSVActionPerformed

    

    /** Closes the dialog */

    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog

        setVisible(false);

        dispose();

    }//GEN-LAST:event_closeDialog

    

    /**

     * @param args the command line arguments

     */

    public static void main(String args[]) {

        new ScatterProps2(new javax.swing.JFrame(), true).setVisible(true);

    }

    
/*
    public void updateInterpolator(){

        interpolator.setColors(col1SV.getColor(),col2SV.getColor(),col3SV.getColor(),col4SV.getColor(),col5SV.getColor());

    }
*/
    

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JTextField Header;
    public javax.swing.JComboBox SbgSV;
    public javax.swing.JTextField Xaxis;
    public javax.swing.JTextField Yaxis;
    public ColorButton axisbgSV;
    public javax.swing.JPanel bgpanels;
    public javax.swing.ButtonGroup buttonGroup1;
    public javax.swing.ButtonGroup buttonGroup2;
    public javax.swing.JPanel buttonpanel;
    public javax.swing.JPanel buttonpanel1;
    public ColorButton chartbgSV;
    public javax.swing.JPanel chartbgpanel;
    public javax.swing.JCheckBox circSV;
    public javax.swing.JButton close;
    public WholeNumberField colorsSV;
    public javax.swing.JButton defaults;
    public WholeNumberField densareaSV;
    public javax.swing.JPanel denspanel;
    public WholeNumberField dotsizeSV;
    public javax.swing.JCheckBox endlabelsSV;
    public javax.swing.JCheckBox frameSV;
    public ColorButton grad1SV;
    public ColorButton grad2SV;
    public javax.swing.JPanel gradientpanel;
    public javax.swing.JComboBox gradtypeSV;
    public ColorButton gridColorSV;
    public javax.swing.JPanel gridpanel1;
    public javax.swing.JButton jButton1;
    public javax.swing.JButton jButton22211;
    public JEPanel jEPanel1;
    public javax.swing.JLabel jLabel1;
    public javax.swing.JLabel jLabel11;
    public javax.swing.JLabel jLabel111;
    public javax.swing.JLabel jLabel112;
    public javax.swing.JLabel jLabel12;
    public javax.swing.JLabel jLabel121;
    public javax.swing.JLabel jLabel12111;
    public javax.swing.JLabel jLabel121111;
    public javax.swing.JLabel jLabel1211111;
    public javax.swing.JLabel jLabel121112;
    public javax.swing.JLabel jLabel1211121;
    public javax.swing.JLabel jLabel121113;
    public javax.swing.JLabel jLabel1212;
    public javax.swing.JLabel jLabel12121;
    public javax.swing.JLabel jLabel122;
    public javax.swing.JLabel jLabel1221;
    public javax.swing.JLabel jLabel1222;
    public javax.swing.JLabel jLabel12221;
    public javax.swing.JLabel jLabel122211;
    public javax.swing.JLabel jLabel122212;
    public javax.swing.JLabel jLabel2;
    public javax.swing.JLabel jLabel21;
    public javax.swing.JLabel jLabel22;
    public javax.swing.JLabel jLabel23;
    public javax.swing.JLabel jLabel3;
    public javax.swing.JLabel jLabel31;
    public javax.swing.JLabel jLabel4;
    public javax.swing.JLabel jLabel5;
    public javax.swing.JLabel jLabel6;
    public javax.swing.JLabel jLabel7;
    public javax.swing.JLabel jLabel8;
    public javax.swing.JPanel jPanel1;
    public javax.swing.JPanel jPanel10;
    public javax.swing.JPanel jPanel11;
    public javax.swing.JPanel jPanel12;
    public javax.swing.JPanel jPanel2;
    public javax.swing.JPanel jPanel3;
    public javax.swing.JPanel jPanel4;
    public javax.swing.JPanel jPanel5;
    public javax.swing.JPanel jPanel6;
    public javax.swing.JPanel jPanel7;
    public javax.swing.JPanel jPanel8;
    public javax.swing.JSeparator jSeparator1;
    public javax.swing.JSeparator jSeparator2;
    public javax.swing.JSeparator jSeparator21;
    public javax.swing.JTabbedPane jTabbedPane1;
    public DoubleField minpSV;
    public WholeNumberField mixticsSV;
    public WholeNumberField miyticsSV;
    public ColorButton nullSV;
    public javax.swing.JRadioButton numpSV;
    public javax.swing.JButton ok;
    public javax.swing.JCheckBox paintGridSV;
    public javax.swing.JTextField pathSV;
    public javax.swing.JPanel picturepanel;
    public DoubleField pointsSV;
    public javax.swing.JButton reset;
    public javax.swing.JCheckBox showTrendSV;
    public ColorButton singlebgSV;
    public javax.swing.JPanel singlebgpanel;
    public javax.swing.JPanel spotpanel;
    public javax.swing.JRadioButton stretchSV;
    public javax.swing.JRadioButton tileSV;
    public javax.swing.JSlider transparencySV;
    public ColorButton trendcSV;
    public javax.swing.JSlider trendtransSV;
    public WholeNumberField tresholdSV;
    public javax.swing.JPanel valuesx;
    public DoubleField weightSV;
    public DoubleField widthSV;
    public javax.swing.JRadioButton xaxSV;
    public javax.swing.JPanel xaxispanel;
    public DoubleField xmax;
    public DoubleField xmin;
    public javax.swing.JCheckBox xticsbothsidesSV;
    public javax.swing.JPanel yaxispanel;
    public DoubleField ymax;
    public DoubleField ymin;
    public javax.swing.JCheckBox yticsbothsidesSV;
    // End of variables declaration//GEN-END:variables

    

}

